<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var arr = [1, 2, 3, 4];
        // unshiftArray(arr, 5);
        // console.log(arr); // [5, 4, 3, 2, 1]
        arr=arr.sort(function (a,b){return b-a})
        arr =[5,...arr]
        console.log(arr)
    </script>
</head>
<body>

</body>
</html>